-- forbid_magic_damage
-- Created by wangy Jun/28/2016
-- 第七封印，创世神获得钻石

return {
    apply = function(source, target, classId, value)
        -- 获取当前出战冈布奥是否触发奖励
        local pet = ME.user:getActivePet();
        local slimeId = pet.classId;
        local bonus = {};

        -- 不是创世神
        if slimeId ~= 39 then
            return false;
        end

        if BuildingBonusM.getFieldStat("seventh_seal") < 1 then
            -- 奖励
            bonus = {2, "gem", 100, };
            BuildingBonusM.addFieldStat("seventh_seal", 1);
            BonusM.doBonus(bonus, "minecraft_gem");
        end

        return 1;
    end,
}